package com.dlut.connectionpool;

import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.pool.DruidDataSourceFactory;
import org.junit.jupiter.api.Test;

import javax.sql.DataSource;
import java.io.InputStream;
import java.sql.Connection;
import java.util.Properties;


public class DruidTest {

    @Test
    public void test() throws Exception {
        Properties pros = new Properties();
        InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream("druid.properties");
        pros.load(is);

        DataSource druid = DruidDataSourceFactory.createDataSource(pros);

        Connection conn = druid.getConnection();
        System.out.println(conn);

    }
}
